#!/usr/bin/env python

from flask import Flask, render_template
from flask_bootstrap import Bootstrap

from flask_wtf import Form
from wtforms import StringField
from wtforms.validators import DataRequired

app = Flask(__name__)

bootstrap = Bootstrap(app)
app.config['SECRET_KEY'] = 'any secret string'

@app.route('/')
def fkbp():
    return render_template('1_flaskbootstrap_test.html')

class Myform(Form):
    name = StringField('name', validators = [DataRequired()])

@app.route('/tform', methods=('GET', 'POST'))
def submit():
    form = Myform()
    if form.validate_on_submit():
        return redirect('/success')
    return render_template('2_form_test.html', form=form)
    


if __name__ == "__main__":
  app.run(host="0.0.0.0", port=8082,debug=True)
